package org.xtremeobjects.forms.ui;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.xtremeobjects.domain.model.Clazz;
import org.xtremeobjects.domain.model.ClazzFactoryImpl;
import org.xtremeobjects.domain.model.ClazzRepository;

public class XObjectEditorInput implements IEditorInput {

	private String className;
	private String objectID;
	
	public XObjectEditorInput(String className, String objectID) {
		this.className = className;
		this.objectID = objectID;
	}

	public boolean exists() {
		// TODO Auto-generated method stub
		return true;
	}

	public ImageDescriptor getImageDescriptor() {
		// TODO Auto-generated method stub
		return Activator.getImageDescriptor("icons/sample.gif");
	}

	public String getName() {
		// TODO Auto-generated method stub
		return this.className;
	}

	public IPersistableElement getPersistable() {
		// TODO Auto-generated method stub
		return null;
		
	}

	public String getToolTipText() {
		// TODO Auto-generated method stub
		return "";
	}

	public Object getAdapter(Class adapter) {
		// TODO Auto-generated method stub
		return null;
	}

	public String getClassName() {
		return className;
	}

	public String getObjectID() {
		return objectID;
	}

	@Override
	public boolean equals(Object arg0) {
		if(arg0 instanceof XObjectEditorInput) {
			XObjectEditorInput other = (XObjectEditorInput)arg0;
			return this.getObjectID().equals(other.getObjectID());
		}
		return false;
	}

	@Override
	public int hashCode() {
		return this.getObjectID().hashCode();
	}
	
	
}
